package com.example.springdatajpaderivedquerymethod.model;

import javax.persistence.*;
import java.util.List;

@Entity
@Table(name = "people")
@NamedStoredProcedureQuery(
        name = People.NamedQuery_Fetch_PEOPLE,
        procedureName = "fetch_people_limit",
        resultClasses = People.class,
        parameters = {
                @StoredProcedureParameter(type = Integer.class,mode = ParameterMode.IN)
        }
)
public class People {
    public static final  String NamedQuery_Fetch_PEOPLE = "fetchPeopleLimit";
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    private String firstName;
    private String lastName;
    private String address;

    public People() {
    }

    public People(String firstName, String lastName, String address) {
        this.firstName = firstName;
        this.lastName = lastName;
        this.address = address;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }
}
